<template>
    <el-form-item label="" :prop="`adgroup.delivery.${dataForm.delivery_index}.schedule_start_time`" :rules="{required: true, message: '请选择', trigger: ['blur', 'change']}">
        <el-date-picker @change="sessionSave" :clearable="false" v-model="dataForm.adgroup.delivery[dataForm.delivery_index].schedule_start_time" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="选择日期时间" :picker-options="pickerOptions">
        </el-date-picker>
    </el-form-item>
</template>

<script>
export default {
    props: ["dataForm"],
    components: {},
    name: "",
    data() {
        return {
            pickerOptions: {
                disabledDate(time) {
                    return time.getTime() < Date.now() - 8.64e7; //如果没有后面的-8.64e7就是不可以选择今天的
                },
            },
        };
    },
    created() {
        if(!this.dataForm.adgroup.delivery[this.dataForm.delivery_index].schedule_start_time){
            let start_date = this.dayjs().format("YYYY-MM-DD HH:mm:ss");
            this.dataForm.adgroup.delivery[this.dataForm.delivery_index].schedule_start_time = start_date
        }
    },
    methods: {
        sessionSave(){
            this.$emit("sessionSave")
        }
    },
};
</script>


<style scoped>
</style>

